package com.hu.zhcc.shiro.controller;

import com.hu.zhcc.shiro.entity.bo.CheckGroup;
import com.hu.zhcc.shiro.entity.bo.CheckItem;
import com.hu.zhcc.shiro.entity.bo.OrderSetting;
import com.hu.zhcc.shiro.entity.vo.CheckGroupVO;
import com.hu.zhcc.shiro.service.CheckGroupService;
import com.hu.zhcc.shiro.service.OrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/ordersetting")
public class OrderSettingController {
    @Autowired
    private OrderSettingService orderSettingService;

    @PostMapping("")
    public ResponseEntity<?> editNumberByDate(@RequestBody OrderSetting orderSetting) {
        System.out.println(orderSetting);
        try{
            orderSettingService.editNumberByDate(orderSetting);
            String s = "获取预约设置数据成功";
            return ResponseEntity.noContent().build();
        }catch (Exception e){
            e.printStackTrace();
            String s = "获取预约设置数据失败";
            return ResponseEntity.notFound().build();
        }
    }

    @GetMapping("/all")
    public List getById() {
        return orderSettingService.getOrderSettingByMonth();
    }

}
